[examples] Added shapes_recursive_tree#5229
Conversation
shapes_recursive_tree
shapes_recursive_treeshapes_recursive_tree
| Vector2 initialEnd = CalculateBranchEnd(start, 0.0f, length); | ||
| branches[count++] = (Branch){start, initialEnd, 0.0f, length}; | ||
|
|
||
| for (int i = 0; i < count; i++) { |
There was a problem hiding this comment.
Please, could you review it to follow raylib code conventions with aligned brackets?
|
|
||
| float nextLength = branch.length * branchDecay; | ||
|
|
||
| if (count < maxBranches && nextLength >= 2) { |
There was a problem hiding this comment.
Please, could you review it to follow raylib code conventions with aligned brackets?
|
|
||
| ClearBackground(RAYWHITE); | ||
|
|
||
| for (int i = 0; i < count; i++) { |
There was a problem hiding this comment.
Please, could you review it to follow raylib code conventions with aligned brackets?
| return 0; | ||
| } | ||
|
|
||
| static Vector2 CalculateBranchEnd(Vector2 start, float angle, float length) { |
There was a problem hiding this comment.
Please, could you review it to follow raylib code conventions with aligned brackets?
|
|
||
| InitWindow(screenWidth, screenHeight, "raylib [shapes] example - shapes recursive tree"); | ||
|
|
||
| Vector2 start = { (screenWidth / 2.0f) - 125, screenHeight }; |
There was a problem hiding this comment.
Please, could you review to follow raylib code conventions?
| { | ||
| // Update | ||
| //---------------------------------------------------------------------------------- | ||
| float theta = angle * DEG2RAD; |
There was a problem hiding this comment.
Please, could you review to follow raylib code conventions?
|
|
||
| static Vector2 CalculateBranchEnd(Vector2 start, float angle, float length) { | ||
| return (Vector2){ | ||
| start.x + length * sinf(angle), |
There was a problem hiding this comment.
Please, could you review to follow raylib code conventions?
|
@Jopestpe Looks very good, just reviewed some minor format tweaks, to follow raylib code conventions. Thanks! |
|
I think nothing will escape the conventions now 😅 |
|
@Jopestpe great! thanks! 👍😄 |
* ADDED: example: shapes_recursive_tree * [examples] Added shapes_recursive_tree * [examples] shapes_recursive_tree: adjustments * Reduced tree depth from 12 to 10 * new shapes_recursive_tree.png * follow the conventions * follow the conventions 2
Description
Changelog
Tested and compiles successfully on Linux
